package cn.iocoder.yudao.hires.mapper;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.hires.entity.ResumeProjectDO;
import cn.iocoder.yudao.hires.vo.ResumeProjectPageReqVO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 简历-项目经历 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ResumeProjectMapper extends BaseMapperX<ResumeProjectDO> {

    default PageResult<ResumeProjectDO> selectPage(ResumeProjectPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ResumeProjectDO>()
                .eqIfPresent(ResumeProjectDO::getUserId, reqVO.getUserId())
                .likeIfPresent(ResumeProjectDO::getProjectName, reqVO.getProjectName())
                .betweenIfPresent(ResumeProjectDO::getStartTime, reqVO.getStartTime())
                .betweenIfPresent(ResumeProjectDO::getEndTime, reqVO.getEndTime())
                .eqIfPresent(ResumeProjectDO::getProjectDescription, reqVO.getProjectDescription())
                .betweenIfPresent(ResumeProjectDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ResumeProjectDO::getId));
    }

}